<?php require_once VIEWPATH . 'common/header.php'; ?>
<link rel="stylesheet" type="text/css" href="<?= STATICURL; ?>h-ui/css/page.css" />
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 其他 <span class="c-gray en">&gt;</span> 物流列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <a class="btn btn-primary radius" data-title="添加账目" data-href="article-add.html"
               onclick="express_add('添加快递','/express/editview',600,300)"><i class="Hui-iconfont">&#xe600;</i> 添加物流</a>
        </span>
    </div>
    <div class="mt-20">
        <table id="process" class="table table-border table-bordered table-bg table-hover  table-responsive">
            <thead>
            <tr class="text-c">
                <th width="80">物流名称</th>
                <th width="80">物流标识码</th>
                <th width="120">排序</th>
                <th width="120">操作</th>
            </tr>
            </thead>
            <tbody>
            <?php if($express_list):?>
            <?php foreach ($express_list as $row): ?>
                <tr class="text-c">
                   <td><?= $row['name'] ?></td>
                    <td><?= $row['express_marking'] ?></td>
                    <td><?= $row['sort_order'] ?></td>
                    <td class="f-14 td-manage">
                            <a style="text-decoration:none" class="ml-5" onClick="express_add('物流编辑','/express/editview?express_id=<?=$row['express_id']?>')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a>
                        <a style="text-decoration:none" class="ml-5" onClick="express_del(this,<?= $row['express_id'] ?>)" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
                    </td>
                </tr>
            <?php endforeach; ?>
            <?php else:?>
                <tr >
                    <td style="text-align: center" colspan="18">暂无数据</td>
                </tr>
            <?php endif;?>
            </tbody>
        </table>
    </div>
</div>
<!--请在下方写此页面业务相关的脚本-->
<?php require_once VIEWPATH . 'common/footer.php'; ?>
<script>
    function express_add(title,url,w,h){
        layer_show(title,url,w,h);
    }
    function express_del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            $.ajax({
                type: 'POST',
                url: '/express/delete',
                data: {express_id: id},
                dataType: 'json',
                success: function (data) {
                    window.location.reload();
                    layer.msg(data.message);
                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    }
</script>

